<el-dialog :close-on-click-modal="false"  :close-on-press-escape="false"  class="dialogStyleBase maxHeight" :title="dialogTitle" width="94vw" :visible.sync="mixinEdit_editVisible"
    :before-close="hideBox" append-to-body @opened="opened">
    <div class="" v-loading="loading">
        <el-form ref="editForm" :model="form" label-width="100px">

            <LayoutCell>
                <LayoutCellItem title="等级信息">

                    <el-form-item label="等级权重">
                        <div class="level-weight">
                            <span :class="{'item':form.grade != item.num,'currentItem':form.grade == item.num}"
                                v-for="(item,index) of gradeList" :key="index" @click="selectGrade(item.num)">
                                {{item.name}}
                            </span>
                        </div>
                    </el-form-item>
                    <el-form-item label="等级名称">
                        <el-input v-model="form.name" placeholder="请填写等级名称" maxlength="10" show-word-limit
                            style="width:200px"></el-input>
                    </el-form-item>
                    <el-form-item label="等级描述">
                        <el-input type="textarea" v-model="form.remark" placeholder="请填写等级描述" maxlength="90"
                            show-word-limit style="width:400px" autosize></el-input>
                    </el-form-item>

                </LayoutCellItem>

                <LayoutCellItem title="会员权益">

                    <el-form-item label="权益设置">
                        <el-radio-group v-model="form.isOpenRight">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="等级权益" v-if="form.isOpenRight">
                        <el-button plain @click="selectPower">选择权益</el-button>
                    </el-form-item>
                    <el-form-item label="已选择权益" v-if="form.isOpenRight">
                        <div class="selected">
                            <span class="rule-item" v-for="(item,index) of ruleInfoList" :key="index">
                                {{item.rightRuleName + ','}}
                            </span>
                        </div>
                    </el-form-item>

                </LayoutCellItem>

                <LayoutCellItem title="升级条件" v-if="!isDefault && form.grade != 1">
                    <el-form-item label="满足条件">
                        <el-radio-group v-model="form.isCondition">
                            <el-radio :label="1">同时满足勾选条件</el-radio>
                            <el-radio :label="0">满足任一勾选条件</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item>
                        <el-checkbox v-model="form.subscribeWeChatMp.isSelect" :true-label="1" :false-label="0">关注公众号
                        </el-checkbox>
                    </el-form-item>
                    <el-form-item>
                        <el-checkbox v-model="form.buyProduct.isSelect" :true-label="1" :false-label="0">购买指定商品
                        </el-checkbox>
                        <span class="tips">下单任意一件商品后计入</span>
                    </el-form-item>
                    <el-form-item v-if="form.buyProduct.isSelect">
                        <!-- //count 选择商品数量  -1 不限制  0不可选择 正整数为可选多少项 -->
                        <SelectDataGoods v-model="goodsIds" :appWindow="appWindow" :count="-1"></SelectDataGoods>
                    </el-form-item>
                    <el-form-item prop="consumeCount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorConsumeCount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.consumeCount.isSelect" :true-label="1" :false-label="0">消费次数大于等于
                        </el-checkbox>
                        <el-input v-model="form.consumeCount.conditionValue" style="width: 200px;margin-left: 20px;"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" maxlength="10"
                            :disabled="!form.consumeCount.isSelect">
                            <template slot="append">次</template>
                        </el-input>
                        <span class="tips">下单次数，支付后计入</span>
                    </el-form-item>
                    <el-form-item prop="consumeAmount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorConsumeAmount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.consumeAmount.isSelect" :true-label="1" :false-label="0">消费金额大于等于
                        </el-checkbox>
                        <el-input v-model="form.consumeAmount.conditionValue" style="width: 200px;margin-left: 20px;"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" maxlength="10"
                            :disabled="!form.consumeAmount.isSelect">
                            <template slot="append">元</template>
                        </el-input>
                        <span class="tips">实付金额+积分抵扣+余额抵扣总金额，支付后计入</span>
                    </el-form-item>
                    <el-form-item prop="rechargeCount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorRechargeCount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.rechargeCount.isSelect" :true-label="1" :false-label="0">充值次数大于等于
                        </el-checkbox>
                        <el-input v-model="form.rechargeCount.conditionValue" style="width: 200px;margin-left: 20px;"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" maxlength="10"
                            :disabled="!form.rechargeCount.isSelect">
                            <template slot="append">次</template>
                        </el-input>
                        <span class="tips">会员充值次数</span>
                    </el-form-item>
                    <el-form-item prop="rechargeAmount.conditionValue"
                        :rules="[{trigger: ['blur','change'] ,validator:function(rule, value, callback){validatorRechargeAmount(rule, value, callback)}}]">
                        <el-checkbox v-model="form.rechargeAmount.isSelect" :true-label="1" :false-label="0">充值金额大于等于
                        </el-checkbox>
                        <el-input v-model="form.rechargeAmount.conditionValue" style="width: 200px;margin-left: 20px;"
                            onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" maxlength="10"
                            :disabled="!form.rechargeAmount.isSelect">
                            <template slot="append">元</template>
                        </el-input>
                        <span class="tips">会员充值金额</span>
                    </el-form-item>
                    <el-form-item>
                        <el-radio-group v-model="form.conditionNode">
                            <el-radio :label="1">付款后</el-radio>
                            <el-radio :label="2">完成后</el-radio>
                        </el-radio-group>
                        <span class="tips">消费条件统计的方式</span>
                    </el-form-item>
                </LayoutCellItem>

            </LayoutCell>
        </el-form>
    </div>






    <div slot="footer">
        <el-row>

            <el-col :span="12">
                <el-button :disabled="loading" @click="cancel">取 消</el-button>
                <el-button :disabled="loading" type="primary" @click="submit">确
                    定</el-button>
            </el-col>
        </el-row>
    </div>



</el-dialog>